Using Queries, Patterns, and Wildcards

The management interface supports queries and UNIX-style patterns and wildcards to enable you to match multiple values in command-parameter arguments. The following query operators are supported:

Table 1.2. Query Operators

OperatorDescription
*Wildcard that matches all entries.
!NOT operator. Indicates a value that is not to be matched; for example, !vs0 indicates not to match the value vs0.
|OR operator. Separates two values that are to be compared; for example, vs0 | vs2 matches either vs0 or vs2. You can specify multiple OR statements; for instance, a | b* | *c* matches the entry a, any entry that starts with b, and any entry that includes c.
..Range operator. For example, 5..10 matches any value from 5 to 10, inclusive.
<Less-than operator. For example, <20 matches any value that is less than 20.
>Greater-than operator. For example, >5 matches any value that is less than
<=Less-than-or-equal-to operator.
>=Greater-than-or-equal-to operator.
{query}Extended query; see “Using Extended Queries” for details.

For instance, to display a list of all volumes whose names include the string tmp, run the following command:

node::> volume show -volume *tmp*

Using Extended Queries

You can also use extended queries to match and perform operations on objects that have specified values. Extended queries are specified by enclosing them within curly brackets ({}). An extended query must be specified as the first argument after the command name, before any other parameters. For instance, to set offline all volumes whose names include the string tmp, run the following command:

node::> volume modify {-volume *tmp*} -state offline

Extended queries are generally useful only with modify and delete commands; they have no meaning in new or show commands.

Note:

The combination of queries and modify operations is a useful tool; however, it can potentially cause confusion and errors if implemented incorrectly. For example, using the system image modify command to set a node's default software image automatically sets the other software image not to be the default. The following command is effectively a null operation:

node::> system image modify {-isdefault true} -isdefault false

This command sets the current default image as the non-default image, then sets the new default image (the previous non-default image) to the non-default image, resulting in the original default settings being retained. To perform the operation correctly, you can use the following command:

node::> system image modify {-iscurrent false} -isdefault true